import api from '@/utils/request'
import jsCookie from 'js-cookie'

const API = {
  /**
   * 判断是否登录
   */
  async GetToken() {
    const res: any = await api({
      url: 'Common/GetToken',
      method: 'POST',
      data: { Param: jsCookie.get('userId') }
    })
    if (res.Tag) {
      return res.Data
    }
  },
  //登录
  async LoginByPwd(params) {
    return await api({
      url: 'Member/LoginByPwd',
      method: 'POST',
      data: params
    })
  },
  //实验室家数统计
  async GetHeadOfficeDataCylindricalChart(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetHeadOfficeDataCylindricalChart',
      method: 'POST',
      data: params
    })
  },
  // 可疑数据 离散数据
  async GetSuspiciousDataChart(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetSuspiciousDataChart',
      method: 'POST',
      data: params
    })
  },
  async GetLocalSuspiciousDataChart(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetLocalSuspiciousDataChart',
      method: 'POST',
      data: params
    })
  },
  // 结果优秀占比
  async GetExcellentDataChart(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetExcellentDataChart',
      method: 'POST',
      data: params
    })
  },
   // 结果优秀占比
   async GetLocalExcellentDataChart(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetLocalExcellentDataChart',
      method: 'POST',
      data: params
    })
  },
  async GetLabDataChart(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetLabDataChart',
      method: 'POST',
      data: params
    })
  },
  // 地图
  async GetMapDataChart(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetMapDataChart',
      method: 'POST',
      data: params
    })
  },
  // 地图
  async GetLocalMapDataChart(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetLocalMapDataChart',
      method: 'POST',
      data: params
    })
  },
  //再现性与推荐试验方法的规定再现性比较表
  async GetReproducibilityData(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetReproducibilityData',
      method: 'POST',
      data: params
    })
  },
  //实验室对应数据总体情况表
  async GetOverallData(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetOverallData',
      method: 'POST',
      data: params
    })
  },
  // 实验室对应可疑结果情况表
  async GetSuspiciousData(params) {
    const token = await API.GetToken()
    jsCookie.set('token', token)
    return await api({
      url: 'BigScreen/GetSuspiciousData',
      method: 'POST',
      data: params
    })
  },
  
}
export default API